package com.ruicar.afs.cloud.admin.api.event;

import com.ruicar.afs.cloud.common.core.event.AfsEvent;
import com.ruicar.afs.cloud.common.core.util.SpringContextHolder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;


@Component
@Slf4j
public class AfsRoleChangeEventTrigger implements AfsEvent<RoleChangeEventParam> {
    @Override
    public Boolean fire(RoleChangeEventParam roleChangeEventParam) {
        try {
            return SpringContextHolder.getBean(AfsOnRoleChange.class).onRoleChange(roleChangeEventParam);
        }catch (Throwable e){
            return true;
        }
    }
}
